﻿using System;
using System.Management.Automation;
using System.Management.Automation.Runspaces;
using BGShell.Drawing;

namespace BGShell.PowerShell.DataTips
{
    internal sealed class VariableDataTip : PSObjectDataTip
    {
        private readonly Runspace _runspace;

        public VariableDataTip(Runspace runspace, String name)
            : base(name, null, false, null)
        {
            _runspace = runspace;
            Icon = TypeModelIcon.Field;
        }

        public override object Value
        {
            get
            {
                return _runspace.SessionStateProxy.GetVariable(Name);
            }
            set { }
        }
    }
}